import request from '@/utils/request'

// 查询
export function list(query) {
  return request({
    url: '/api/personalTrainings',
    method: 'get',
    params: query
  })
}
// 新增
export function add(data) {
  return request({
    url: '/api/personalTrainings',
    method: 'post',
    data: data
  })
}
// 修改
export function update(data) {
  return request({
    url: '/api/personalTrainings',
    method: 'put',
    data: data
  })
}
// 详情
export function detail(query) {
  return request({
    url: '/api/personalTrainings/' + query.id,
    method: 'get'
  })
}
// 删除
export function remove(query) {
  return request({
    url: '/api/personalTrainings/' + query.id,
    method: 'delete'
  })
}
// 撤回培训记录
export function revocation(data) {
  return request({
    url: '/api/personalTrainings/recalls/' + data.id,
    method: 'patch'
  })
}

// 审批培训记录列表
export function approvalList(query) {
    return request({
      url: '/api/personalTrainings/audits',
      method: 'get',
      params: query
    })
  }

// 审批培训记录
export function approval(data) {
  return request({
    url: '/api/personalTrainings/audits',
    method: 'patch',
    data: data
  })
}
